home *** CD-ROM | disk | FTP | other *** search
- Path: news.nask.org.pl!usenet
- From: flssoft@blue.maloka.waw.pl (Grzegorz (FLS))
- Newsgroups: comp.lang.c++
- Subject: Re: Is this possible?
- Date: Wed, 27 Mar 1996 20:15:45 GMT
- Organization: Research and Academic Computer Network
- Message-ID: <4jc7h7$3hh@bilbo.nask.org.pl>
- References: <4j26t6$shm@arl-news-svc-3.compuserve.com>
- NNTP-Posting-Host: s112.maloka.waw.pl
- X-Newsreader: Forte Free Agent v0.46
-
- Philippe Verdy <100105.3120@compuserve.com> wrote:
-
- Hi,
-
- I think, that there is a problem of SMALL memory model. You have onlu
- 64K for your data. Of course you can have a far pointer like:
-
- unsigned char far *ptr ;
-
- and cast the result of a new operator to unsigned char far* type,
- but you are limited with memory that you can allocate in SMALL memory
- model. In this model you can got only one segment < 64K for data.
- When you call:
- ptr[0]=(unsigned char far *)farmalloc(64001);
- the result pointer will be proper (!=NULL) only if there is such
- memory (not fragmented) to realise your question. I guess, that
- program, before this line "has consumed" more than 65K - 64001 of
- memory, and you have NULL pointer because of allocation failure. _Not_
- because of restriction with far memory allocation.
-
- Conclusion - you have to change memory model to have more than one
- segment of data - for example for medium.
-
- That's all,
- Good luck :)
-
- Grzegorz
-
- ``````````````````````````` Grzes vel Pysiak
- Ablue, pecte canem, canis est et permanet idem.
- Desunt cetera!
-
-